{% extends 'base.html' %} 
{% block link_for_style %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/post.css', _external=True) }}">
 {% endblock %} 
 {% block title %} {{ post.title }} {% endblock %} {% block body %}

<!--post, tags, form, comments, recent, top_tags-->
<!--edit block-->

<div class="col-md-12 post">
    <!--Get the pagination object-->
    <div class="card">
        <div class="card-content">
            <!--Header-->
            <div class="col-md-12">
                <a href="{{ url_for('blog.post', post_id=post.id) }}">
                    <h4 class="" style="border-left-style:groove; border-left-color:blueviolet;">
                        {{ post.title }}
                    </h4>
                </a>
            </div>
            <!--Tag-->
            <div class="tags">
                <ul>
                    <li >By:<a href="">{{ post.users.username }}</a></li>
                    <li style="">{{post.publish_date}}</li>
                    {% for tag in post.tags %}
                    <li style=""> <span class="label label-info">{{ tag.name }}</span></li>
                    {% endfor %}
                </ul>
            </div>
        </div>
        <hr>
        <div class="">
            <div class="col-sm-12-">
                <!--Post-->
                    {{ post.text | safe }}
            </div>
            <ul>
                {% if current_user.is_authenticated %}
                <li style="display:inline-block;"><a href="{{ url_for('blog.edit_post', id=post.id) }}" class="btn btn-sm btn-default">Edit</a></li>
                {% endif %}
            </ul>
        </div>
    </div>

    {% for comment in comments %}
    <div class="card">
        <div class="card-content">
            <h4>From:{{ comment.name }}</h3>
                <h5>Date:{{ comment.date }}</h3>
                    <p>Say :{{ comment.text }}</p>
        </div>
    </div>
    {% endfor %}

    <div class="card">
        <div class="card-content">
            <!--post form-->
            <form method="POST" action="{{ url_for('.post', post_id=post.id)}}">
                {{form.hidden_tag()}}
               <div class="" style="">
                    {{ form.name.label }} <br />
                    {% if form.name.errors %} {% for e in form.name.errors %}
                    <p class="help-block">{{ e }}</p>
                    {% endfor %} {% endif %} {{form.name(class_="form-control", value="")}}
                </div>
                <div class="" style="">
                    {{ form.email.label }} <br />
                    {{ form.email(class_="form-control", value="")}}
                </div>
                <div class="">
                    {{ form.text.label }} {% if form.text.errors %} {% for e in form.text.errors %}
                    <p class="help-block">{{ e }}</p>
                    {% endfor %} {% endif %} 
                    {{form.text(class_="form-control")}}
                </div>
                <input clas="btn btn-primary" type="submit" value="Add Comment">
            </form>
            <br>
        </div>
    </div>

    <!--Footer nav-->
</div>
<div class="col-sm-3-"></div>


{% endblock %}